package com.ruoyi.cms.domain;


/**
 * 素材使用记录实体类
 */
public class MaterialUse extends Material {
    /*主键ID*/
    private String id;
    /*素材在那张表中使用*/
    private String useTable;
    /*比如cms_album_material表的album_id字段的列名“album_id”*/
    private String useColumn;
    /*比如cms_album_material表的material_id字段*/
    private String materialColumn;
    /*比如cms_album_material表的album_id字段*/
    private String useId;
    /*创建人ID*/
    private String userId;
    /*
    * 素材关联删除时执行的操作
    * DELETE 删除记录
    * UPDATE 置空字段
    * NONE 不做任何操作
    * NOT 不允许删除
    */
    public enum Type{
        DELETE,
        SET_NULL,
        NONE,
        NOT
    }
    private Type type;

    private String ids;//扩展字段

    public MaterialUse() {
    }

    public MaterialUse(String table, String useId, String column, String materialColumn) {
        this.useTable = table;
        this.useId = useId;
        this.useColumn = column;
        this.materialColumn = materialColumn;
    }

    @Override
    public String toString() {
        return "MaterialUse{" +
                "id='" + id + '\'' +
                ", useTable='" + useTable + '\'' +
                ", useId='" + useId + '\'' +
                ", userId='" + userId + '\'' +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUseTable() {
        return useTable;
    }

    public void setUseTable(String useTable) {
        this.useTable = useTable;
    }

    public String getUseColumn() {
        return useColumn;
    }

    public void setUseColumn(String useColumn) {
        this.useColumn = useColumn;
    }

    public String getMaterialColumn() {
        return materialColumn;
    }

    public void setMaterialColumn(String materialColumn) {
        this.materialColumn = materialColumn;
    }

    public String getUseId() {
        return useId;
    }

    public void setUseId(String useId) {
        this.useId = useId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public String getIds() {
        return ids;
    }

    public void setIds(String ids) {
        this.ids = ids;
    }
}
